package cz.muni.fi.pa165.rentalofconstructionmachinery.dao;

import cz.muni.fi.pa165.rentalofconstructionmachinery.entity.Machine;
import cz.muni.fi.pa165.rentalofconstructionmachinery.entity.Revision;
import java.util.List;

/**
 *
 * @author Adam Zmrzlý
 * @version Gallardo (20121018)
 */
public interface RevisionDAO {
    /*
     * Creates a new revision. Revision and revision.machine cannot be null.
     * @param revision A revision to be created.
     */
    public void createRevision(Revision revision);
    /*
     * Deletes a revision. Revision cannot be null.
     * @param revision A revision to be deleted.
     */
    public void deleteRevision(Revision revision);
    /*
     * Updates a revision. Revision and revision.machine cannot be null.
     * @param revision A revision to be updated.
     */
    public void updateRevision(Revision revision);

    /*
     * Retrieves all revisions.
     * @return List of all revisions.
     */
    public List<Revision> getAllRevisions();
    /*
     * Retrieves a specific revision.
     * @param id An id of revision to retrieve.
     * @return A revision with given id.
     */
    public Revision getRevisionById(Long id);
    /*
     * Retrieves the last revision of a given machine. Machine cannot be null.
     * @param machine A machine for which retrieve the last revision.
     * @return Last revision of a given machine.
     */
    public Revision getLastRevisionOfMachine(Machine machine);
    /*
     * Retrieves all revisions of a given machine. Machine cannot be null.
     * @param machine A machine for which retrieve all its revisions.
     * @return List of all revisions of a given machine.
     */
    public List<Revision> getAllRevisionsOfMachine(Machine machine);

}
